<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_users
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 * @since		1.6
 */

defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.noframes');

?>
<?php                        	       
$input_username = JText::_( 'Indtast din username' );
$input_email = JText::_( 'Indtast din email' );
$input_password1 = JText::_( 'Indtast din password' );
$input_password2 = JText::_( 'Indtast din bekræft password' );
	
?>                        
 <script type="text/javascript">                   
jQuery(document).ready(function(jQuery) {
	jQuery.validator.addMethod('postalcode', function (value) { 
		if(value=='') return true;	
		return /^\d{4}$/.test(value); 
	   }, '');
		
		
		jQuery("#f-signup").validate(
			{
				errorPlacement: function(error, element) {			
			},
			invalidHandler: function(form, validator) {
			  var errors = validator.numberOfInvalids();
			if (errors) {
                //$('#alert').html(validator['errorList'][0]['message']);
				jQuery('#alert').html(validator['errorList'][0]['message']);
    			jQuery('#backoverlay').show();
    			jQuery('#show_popup').show();
            	jQuery('#f_focus').html(validator['errorList'][0]['element'].name);
				validator['errorList'][0]['element'].focus();
				
			  } else {
			  }
			},
			rules: {
				email : {
					required: true,
					email:true,
				
				},				
				password1 : "required",
				password2 : {
					required: true,
					equalTo: "#password1"
				
				}	
				
			},
			messages: {
				email: "<?php echo $input_email; ?>",
				password1: "<?php echo $input_password1; ?>",
				password2: "<?php echo $input_password2; ?>"
				
			}
		});
        close_popup=function(){		
			var fel=jQuery('#f_focus').html();
            jQuery('#backoverlay').hide();
    		jQuery('#show_popup').hide();
    		jQuery('#' + fel ).focus();		
      };
      
      
	});
</script>
<div id="header">
  <div id="w-header">
    <div class="logo"><a href="index.php">Forside</a> </div>
    <!--.logo-->
     {module login menu}    
    <!--.nav-top-1-->
    <div class="clear"></div>
    <div class="main-nav">
      {module main menu}
    </div>
    <!--.main-nav-->
    <div class="clear"></div>
  </div>
  <!--#w-header--> 
</div>
<!--#header-->

<div id="main">
  <div id="w-main">
    <div id="main-left">
	<div class="left-find"></div>
	<div class="right-find"></div>
		<div class="find">
			{module search}
		</div> 
      <!--.find-->
      <div class="clear"></div>
      <div class="infomation">
		<?php $article = JUtility::getArticle(15); ?>
        <h2><a href="#"><?php echo $article->title; ?></a></h2>
        <?php echo $article->introtext; ?>
      </div>
      <!--.infomation--> 
    </div>
    <!--#main-left-->
    <div id="main-right2">
     <div id="login-page">
	 <?php $article = JUtility::getArticle(6); ?>
    
    <div class="w-login-form">
    <h2><?php echo $article->title;?></h2>
      	<form class="f-signup" name="f-signup" id="f-signup" action="" method="post">
        	<fieldset>
            	<p class="m-b-20"><?php echo strip_tags($article->introtext,"<b><br><a>");?></p>                
            	<div>
                	<input class="rad" name="usertype" value="2" type="radio" checked="checked">
                    <span>Jeg har brug for catering</span>
                </div>
                <div class="clear"></div>
                <div class="m-t-10">
                	<input class="rad" name="usertype" value="9" type="radio">
                    <span>Cateringsvirksomhed</span>
                </div>
               <div class="clear"></div>
                <div>
               	  <label>Email:</label><br>
                    <input value="" type="text" name="email" id="email">
                </div>
                <div>
               	  <label>password:</label><br>
                    <input value="" type="password" name="password1" id="password1">
                </div>
                <div class="m-b-16">
               	  <label>Bekræft password:</label><br>
                    <input value="" type="password" name="password2" id="password2">
                </div>
               
                <div class="bnt-register">
                	<a onclick="jQuery('#f-signup').submit();">register</a>
                </div><!--bnt-register-->
                <div class="back">
                	<h4><a  onclick="javascript:history.back();" >Tilbage</a></h4>
                </div><!--.black-->
                <input type="hidden" name="option" value="com_users" />
				<input type="hidden" name="task" value="registration1.register1" />
				<?php echo JHtml::_('form.token');?>
            
            </fieldset>
        </form>
        <div class="clear"></div>
    </div><!--#login-page-->
    </div><!--.w-login-form-->
    <!--#main-right--> 
  </div>
  <!--#w-main--> 
</div>
<!--#main-->
<div class="clear"></div>
<div id="contact">
  <div id="w-contact">
    <div class="left-con">
      <div class="left-con-top"></div>
      <!--left-con-top-->
      <div class="left-con-mid">
        <div class="contact-con">
		<?php $article = JUtility::getArticle(17); ?>
          <h2><a href="#"><?php echo $article->title; ?></a></h2>
          <?php echo $article->introtext; ?>
        </div>
        <!--.contact-con-->
        <div class="contact-con contact-con2">
			<?php $article = JUtility::getArticle(18); ?>
			<h2><a href="#"><?php echo $article->title; ?></a></h2>
			<?php echo $article->introtext; ?>
        </div>
        <!--.contact-con--> 
      </div>
      <!--left-con-mid-->
      <div class="left-con-bottom"></div>
      <!--left-con-bottom--> 
    </div>
    <!--.left-con-->
    
    <div class="address">
		<?php $article = JUtility::getArticle(16); ?>
		<h2><?php echo $article->title; ?></h2>
		<?php echo $article->introtext; ?>
    </div>
    <!--address--> 
    
    <div class="contact-form">
		{module kontakt}
    </div><!--.contact-form-->
  </div>
  <!--w-contact--> 
</div>
<!--#contact-->
<div class="clear"></div>
<div id="copyright">
	<div id="w-copyright">
		{module footer}
	</div>
</div>
<!--#copyright-->




<?php return; ?>  
  <div id="header2">
  <div id="w-header2">
   	<div class="logo2"><a href="<?php echo JRoute::_('.');?>">kokketilbud</a></div><!--.logo2-->
  </div>
  <!--#w-header2--> 
</div>
<!--#header2-->
<div id="main2">
  <div id="w-main2">
    <div id="login-page">
    <h2><?php echo $article->title;?></h2>
    <div class="w-login-form m-b-100">
      <div class="login-mid-page">
      	<form class="f-signup" name="f-signup" id="f-signup" action="" method="post">
        	<fieldset>
            	<p class="m-b-20"><?php echo strip_tags($article->introtext,"<b><br><a>");?></p>                
            	<div>
                	<input class="rad" name="usertype" value="2" type="radio" checked="checked">
                    <span>Jeg har brug for catering</span>
                </div>
                <div class="clear"></div>
                <div class="m-t-10">
                	<input class="rad" name="usertype" value="9" type="radio">
                    <span>Cateringsvirksomhed</span>
                </div>
               <div class="clear"></div>
                <div>
               	  <label>Email:</label><br>
                    <input value="" type="text" name="email" id="email">
                </div>
                <div>
               	  <label>password:</label><br>
                    <input value="" type="password" name="password1" id="password1">
                </div>
                <div class="m-b-16">
               	  <label>Bekræft password:</label><br>
                    <input value="" type="password" name="password2" id="password2">
                </div>
               
                <div class="bnt-register">
                	<a onclick="jQuery('#f-signup').submit();">register</a>
                </div><!--bnt-register-->
                <div class="back">
                	<h4><a  onclick="javascript:history.back();" >Tilbage</a></h4>
                </div><!--.black-->
                <input type="hidden" name="option" value="com_users" />
				<input type="hidden" name="task" value="registration1.register1" />
				<?php echo JHtml::_('form.token');?>
            
            </fieldset>
        </form>
        <div class="clear"></div>
      </div><!--.login-mid-page-->
    </div><!--#login-page-->
    </div><!--.w-login-form-->
   </div><!--#w-main2-->   
</div><!--#main2-->








<?php return;?>

<div class="registration<?php echo $this->pageclass_sfx?>">
<?php if ($this->params->get('show_page_heading')) : ?>
	<h1><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
<?php endif; ?>

	<form id="member-registration" action="<?php echo JRoute::_('index.php?option=com_users&task=registration.register'); ?>" method="post" class="form-validate">
<?php foreach ($this->form->getFieldsets() as $fieldset): // Iterate through the form fieldsets and display each one.?>
	<?php $fields = $this->form->getFieldset($fieldset->name);?>
	<?php if (count($fields)):?>
		<fieldset>
		<?php if (isset($fieldset->label)):// If the fieldset has a label set, display it as the legend.
		?>
			<legend><?php echo JText::_($fieldset->label);?></legend>
		<?php endif;?>
			<dl>
		<?php foreach($fields as $field):// Iterate through the fields in the set and display them.?>
			<?php if ($field->hidden):// If the field is hidden, just display the input.?>
				<?php echo $field->input;?>
			<?php else:?>
				<dt>
					<?php echo $field->label; ?>
					<?php if (!$field->required && $field->type!='Spacer'): ?>
						<span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL'); ?></span>
					<?php endif; ?>
				</dt>
				<dd><?php echo ($field->type!='Spacer') ? $field->input : "&#160;"; ?></dd>
			<?php endif;?>
		<?php endforeach;?>
			</dl>
		</fieldset>
	<?php endif;?>
<?php endforeach;?>
		<div>
			<button type="submit" class="validate"><?php echo JText::_('JREGISTER');?></button>
			<?php echo JText::_('COM_USERS_OR');?>
			<a href="<?php echo JRoute::_('');?>" title="<?php echo JText::_('JCANCEL');?>"><?php echo JText::_('JCANCEL');?></a>
			<input type="hidden" name="option" value="com_users" />
			<input type="hidden" name="task" value="registration.register" />
			<?php echo JHtml::_('form.token');?>
		</div>
	</form>
</div>
